﻿import QtQuick 2.0
import "../components"
Item {
    id: root
    property var td;
    property var qd;
    anchors.fill: parent
    Connections{  // qmlre
        target: MACO
        onGqread:{
            qdle.setText(gq)
        }
    }
    Connections{  // qmlre
        target: MACO
        onGqcsread:{
            xs1.setText(gqcs[0]);
            xs2.setText(gqcs[1]);
            xs3.setText(gqcs[2]);
            xs4.setText(gqcs[3]);
            xs5.setText(gqcs[4]);
            xs6.setText(gqcs[5]);
            xs7.setText(gqcs[6]);
            xs8.setText(gqcs[7]);
        }
    }
    Row{
        spacing: 15*dp
        CustomComboBox{
            title: "通道"
            textWidth: 40*dp
            editWidth: 80*dp
            model: ["FAM", "ROX", "VIC", "CY5"]
            onCurrentText: {
                td = text
            }
        }
        LineEditor{
            id : qdle
            title: "激发光强度值"
            editWidth: 90*dp
            textWidth: 100*dp
            intflag: true
            onTextChanged: {
                qd = text;
            }
            Keys.onTabPressed: {
                focus = false
                xs1.focus = true
            }
        }
        PushButton{
            title: "光强读取"
            defaultMode1: true
            onReleased: {
                MACO.gqr();
            }
        }
        PushButton{
            title: "光强写入"
            defaultMode1: true
            onReleased: {
                MACO.gqw(qdle.getText());
            }
        }
    }
    Rectangle{      // 分割线
        width: parent.width
        height: 1
        y: 60*dp
        color: "#EEEEEE"
    }
    Column{
        y: 80*dp
        spacing: 15*dp
        LineEditor{
            id : xs1
            title: "检测1系数"
            editWidth: 360*dp
            douflag: true
            Keys.onTabPressed: {
                focus = false
                xs5.focus = true
            }
        }
        LineEditor{
            id : xs2
            title: "检测2系数"
            editWidth: 360*dp
            douflag: true
            Keys.onTabPressed: {
                focus = false
                xs6.focus = true
            }
        }
        LineEditor{
            id : xs3
            title: "检测3系数"
            editWidth: 360*dp
            douflag: true
            Keys.onTabPressed: {
                focus = false
                xs7.focus = true
            }
        }
        LineEditor{
            id : xs4
            title: "检测4系数"
            editWidth: 360*dp
            douflag: true
            Keys.onTabPressed: {
                focus = false
                xs8.focus = true
            }
        }
        Row{
            spacing: 15*dp
            PushButton{
                title: "读取"
                defaultMode1: true
                onReleased: {
                    MACO.gqxr();
                }
            }PushButton{
                title: "写入"
                defaultMode1: true
                onReleased: {
                    var stringList = [xs1.getText(), xs2.getText(), xs3.getText(), xs4.getText(), xs5.getText(), xs6.getText(), xs7.getText(), xs8.getText()];
                    MACO.gqxw(stringList)
                }
            }
        }
    }Column{
        y: 70*dp
        x: parent.width / 2
        width: parent.width / 2
        spacing: 15*dp
        LineEditor{
            id : xs5
            title: "检测5系数"
            editWidth: 360*dp
            douflag: true
            Keys.onTabPressed: {
                focus = false
                xs2.focus = true
            }
        }
        LineEditor{
            id : xs6
            title: "检测6系数"
            editWidth: 360*dp
            douflag: true
            Keys.onTabPressed: {
                focus = false
                xs3.focus = true
            }
        }
        LineEditor{
            id : xs7
            title: "检测7系数"
            editWidth: 360*dp
            douflag: true
            Keys.onTabPressed: {
                focus = false
                xs4.focus = true
            }
        }
        LineEditor{
            id : xs8
            title: "检测8系数"
            editWidth: 360*dp
            douflag: true
            Keys.onTabPressed: {
                focus = false
                qdle.focus = true
            }
        }
    }
}
